package edu.sctu.alex.projectPratice.subwaysystem.until;

import edu.sctu.alex.projectPratice.subwaysystem.appbean.PeopleAppbean;

/**
 * Created by user03 on 2015/6/2.
 */
public class CheckMethods {

    /**
     * 检查包裹和水的类
     *
     */

     private PeopleAppbean peopleAppbean;

     private String dangerPack = "易燃易爆，管制刀具，枪械，有毒物质";

    public CheckMethods(PeopleAppbean peopleAppbean){
        this.peopleAppbean = peopleAppbean;
    }

    /**
     * 检查包裹的安全
     * @return
     */
    public boolean chaBaoGuo(){
        boolean is_weijin = false;

        if(peopleAppbean.isPack()){
            if(dangerPack.contains(peopleAppbean.getPackName())){
                is_weijin = true;
            }
        }else{
            is_weijin = false;
        }
        return is_weijin;
    }
    /**
     * 检查水的安全
     *
     * @return
     */
    public boolean chaWater(){
        boolean is_weijin = false;
        if(peopleAppbean.isWater()){
            if(dangerPack.contains(peopleAppbean.getWaterName())){
                is_weijin = true;
            }
        }else{
            is_weijin = false;
        }

        return is_weijin;
    }
}
